package com.lyl.servicelive.controller.api;



import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyl.commonutils.R;
import com.lyl.servicelive.entity.Course;
import com.lyl.servicelive.entity.CourseAccount;
import com.lyl.servicelive.entity.CourseConfig;
import com.lyl.servicelive.entity.Visitor;
import com.lyl.servicelive.entity.vo.LiveCourseApiFormVo;
import com.lyl.servicelive.entity.vo.LiveCourseConfigVo;
import com.lyl.servicelive.entity.vo.LiveCourseFormVo;
import com.lyl.servicelive.entity.vo.LiveCourseVo;
import com.lyl.servicelive.service.CourseAccountService;
import com.lyl.servicelive.service.CourseConfigService;
import com.lyl.servicelive.service.CourseService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 直播课程表 前端控制器
 * </p>
 *
 * @author 雷艳玲
 * @since 2022-07-05
 */
@RestController
@RequestMapping("/servicelive/api/course")
public class LiveCourseController {
    @Autowired
    private CourseService liveCourseService;


    @Autowired
    private CourseAccountService  courseAccountService;




    @ApiOperation(value = "分页课程列表")
    @PostMapping("{page}/{limit}")
    public R pageList(
            @ApiParam(name = "page", value = "当前页码", required = true)
            @PathVariable Long page,

            @ApiParam(name = "limit", value = "每页记录数", required = true)
            @PathVariable Long limit){
        Page<Course> pageParam = new Page<Course>(page, limit);
        Map<String, Object> map = liveCourseService.pageListWeb(pageParam);
        return  R.ok().data(map);
    }





}

